<?php
header("Content-Type:json/html;charset=utf8;");

$config = require '../config.php';
$article_id = $_POST['id'];
$conn = new mysqli($config['servername'], $config['username'], $config['password'], $config['dbname']);
$sql = "select * from comment where article_id = '$article_id'";
$result = $conn->query($sql);
$conn->close();

$data = array();
    while ($row = $result->fetch_assoc())
    {
        $data[] = $row;
    }
    $result = ['code' =>1, 'data' => $data,  'msg' => "获取评论列表成功!"];
print_r(json_encode($result));
